#include <my_header.h>

/* Usage:  */
int main(int argc, char *argv[]){                                  
    int pipe_fd = open("shared.pipe", O_RDONLY);
    ERROR_CHECK(pipe_fd, -1, "open read");

    int str_length = 0;
    read(pipe_fd, &str_length, sizeof(int));
    char str[60] = { 0 };
    read(pipe_fd, str, str_length);
    printf("str = %s\n", str);
    
    close(pipe_fd);
    return 0;
}

#if 0
int main(void)
{
    int pipe_fd = open("shared.pipe", O_RDONLY);
    ERROR_CHECK("pipe_fd", -1, "open read");

    char buf[60] = { 0 };
    read(pipe_fd, buf, sizeof(buf));

    printf("buf = %d\n", buf);

    close(pipe_fd);
    return 0;
}

#endif
